package com.huc.design.other.delegate.base;

import java.util.HashMap;
import java.util.Map;

/**
 * @author huc
 * @version 1.0
 * @note 项目经理
 * @date 2021/11/16 16:17
 */
public class Leader implements IEmployee {
    private Map<String, IEmployee> employee = new HashMap<>();

    public Leader() {
        employee.put(TaskEnum.SQL.getTitle(), new EmployeeA());
        employee.put(TaskEnum.PS.getTitle(), new EmployeeB());
    }

    @Override
    public void doing(String task) {
        if (!employee.containsKey(task)) {
            System.out.println(this.getClass().getSimpleName()+"说：这个任务【" + task + "】超出我的能力范围");
            return;
        }
        employee.get(task).doing(task);
    }
}
